import { defineConfig } from 'vitepress'
import { containerPreview, componentPreview } from '@vitepress-demo-preview/plugin'
import { fileURLToPath, URL } from 'node:url'
// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "My Element",
  description: "A comprehensive component library website",
  vite: {
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('../../src', import.meta.url)),
      },
    },
  },

  markdown:{
    config(md){
     md.use(containerPreview)
      md.use(componentPreview)
    }
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: 'Home', link: '/' },
      { text: 'Examples', link: '/components/button' }
    ],

    sidebar: [
      {
        text:'基础组件',
        items:[
          {text: 'Button 按钮',link :'/components/button'},
          {text: 'Icon 图标',link :'/components/icon'},
          {text: 'Collapse 折叠面板',link :'/components/collapse'},
          {text: 'Tooltip 文字提示',link :'/components/tooltip'},
          {text: 'Dropdown 下拉菜单',link :'/components/dropdown'},
          {text: 'Message 消息',link :'/components/message'},
        ]
      },
      {
        text:'表单组件',
        items:[
          {text: 'Input 文字输入',link :'/components/input'},
          {text: 'Switch 开关',link :'/components/switch'},
          {text: 'Select 选择器',link :'/components/select'},
          {text: 'Form 表单',link :'/components/form'},
        ],
      },

    ],

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ]
  }
})
